package cn.wanho.mapper;

import cn.wanho.dto.ExamClassStage;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

@Mapper
public interface ExamClassStageMapper {
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(ExamClassStage record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(ExamClassStage record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    /**
     * @author zxy
     * @date 2022/8/5
     * 将老师阶段试卷绑定 到班级
     * 班级 阶段 老师 开始 结束
     */
    ExamClassStage selectByPrimaryKey(Integer id);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(ExamClassStage record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(ExamClassStage record);

    /**
     * @author zxy
     * @date 2022/8/6
     * classID存在
     */
    Integer existClassId(Integer id);
    /**
     * @author zxy
     * @date 2022/8/6
     * stageId存在
     */
    Integer existStageId(Integer id);
    /**
     * @author zxy
     * @date 2022/8/6
     * teacherId存在
     */
    Integer existTeacherId(Integer id);
    /**
     * @author zxy
     * @date 2022/8/6
     * paperIdL存在
     */
    Integer existpaperIdL(Long id);
    /**
     * @author zxy
     * @date 2022/8/6
     * 重复判断
     */
    List<Integer> existRepeat(Integer classId, Integer stageId, Integer teacherId, Integer paperId);
    /**
     * @author zxy
     * @date 2022/8/6
     * 重复判断2-学生班级
     */
    List<Integer> existRepeat2(Integer classId,Integer studentId);

    /**
     * @author zxy
     * @date 2022/8/6
     * 学生绑定班级
     */
    Integer createClassStudent(Integer classId,Integer studentId);
    /**
     * @author zxy
     * @date 2022/8/6
     * 学生id存在
     */
    Integer existStudent(Integer id);

    Date selectEndTime(int userId);
}